﻿using System.Net.NetworkInformation;

namespace TianlalaHSB.Utils;

public static class NetworkHelper
{
    public static List<string> GetAllActiveMacAddresses()
    {
        var interfaces = NetworkInterface.GetAllNetworkInterfaces();
        return (from ni in interfaces
            where ni.OperationalStatus == OperationalStatus.Up
            select ni.GetPhysicalAddress().GetAddressBytes()
            into macBytes
            select BitConverter.ToString(macBytes).Replace("-", ":").ToUpper()).ToList();
    }
}